package com.jnxx.basic.util;

import com.jnxx.basic.dto.RobotMessage;
import com.jnxx.robot.controller.RobotNotification;
import com.ruoyi.common.core.domain.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.HashMap;

@Component
public class SendRobotMessageUtil {

    @Autowired
    private RobotNotification robotNotification;

    public AjaxResult sendRobotMessage(RobotMessage robotMessage){

        HashMap<String, String> map = new HashMap<>();
        map.put("url", robotMessage.getUrl());
        map.put("text", robotMessage.getText());
        return robotNotification.sendRobotMessage(map);
    }

}
